package com.wcfsy.wechat.wx.um.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wcfsy.wechat.wx.exception.ServiceException;
import com.wcfsy.wechat.wx.pagination.IPage;
import com.wcfsy.wechat.wx.um.dao.IPermissionDao;
import com.wcfsy.wechat.wx.um.entity.Permission;
import com.wcfsy.wechat.wx.um.service.IPermissionService;

@Service
public class PermissionServiceImpl implements IPermissionService {

	@Resource
	private IPermissionDao permissionDao;

	public Long add(Permission permission) throws Exception {
		return permissionDao.add(permission);
	}

	public boolean deleteById(long id) throws Exception {
		if (permissionDao.deleteById(id) > 0) {
			return true;
		}
		return false;
	}

	public void update(Permission permission) throws Exception {
		permissionDao.update(permission);

	}

	public Permission getById(long id) {
		return permissionDao.getById(id);
	}

	public Permission getByPermissionName(String paramString) {
		// TODO Auto-generated method stub
		return null;
	}

	public IPage<Permission> findByParam(Map<String, Object> paramMap,
			int paramInt1, int paramInt2) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Permission> findByParam(Map<String, Object> paramMap) {
		return permissionDao.findByParam(paramMap);
	}

	public IPage<Permission> findAll(int paramInt1, int paramInt2) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<String> getPermisCodeList(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<String> queryPermis(List<Long> paramList) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Permission> queryPermisByPermisCode(String code) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("code", code);
		return permissionDao.findByParam(paramMap);
	}

	public List<Permission> queryPermisByParam(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return null;
	}

	public void batchInsertPermis(List<Permission> paramList)
			throws ServiceException {
		// TODO Auto-generated method stub

	}

}
